package com.cbn.ibcp.web.jishiting.operator.convert;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.cbn.ibcp.jishiting.rms.domain.ResourceStreamOrg;
import com.cbn.ibcp.web.jishiting.operator.vo.ResourceStreamOrgVO;

public class ResourceStreamOrgConvert {

    public static ResourceStreamOrgVO convertToVO(ResourceStreamOrg resourceStreamOrg) {
        if (resourceStreamOrg == null) {
            return null;
        }
        ResourceStreamOrgVO resourceStreamOrgVO = new ResourceStreamOrgVO();
        BeanUtil.copyProperties(resourceStreamOrg, resourceStreamOrgVO);
        resourceStreamOrgVO.setResourceStreamOrgInjectStatus(resourceStreamOrg.getInjectStatus());
        resourceStreamOrgVO.setEpisodeId(StrUtil.toStringOrNull(resourceStreamOrg.getResId()));
        resourceStreamOrgVO.setCreateTime(DateUtil.format(resourceStreamOrg.getCreateTime(), DatePattern.NORM_DATETIME_PATTERN));
        resourceStreamOrgVO.setUpdateTime(DateUtil.format(resourceStreamOrg.getUpdateTime(), DatePattern.NORM_DATETIME_PATTERN));
        return resourceStreamOrgVO;
    }
}
